<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //函数默认参数
        //你要是不给参数传值，js默认的参数值是undefined
        function sum(a=100, b=100) {
            return a + b;
        }

        var result =sum(100,100);
        var result2 =sum(100);
        console.log("result=",result);
        console.log("result2=",result2);
    </script>
</body>

</html>